﻿<Page x:Class="University.Workshop.Presentation.Users.SearchUser"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      Height="563" Width="780"
	Title="SearchUser" xmlns:my="clr-namespace:University.Workshop.Presentation.ControlWPF" Loaded="Page_Loaded"
      xmlns:ViewsConverter="clr-namespace:University.Workshop.Presentation.ViewsConverter">
    <Page.Resources>

        <ViewsConverter:BooleanToVisibility x:Key="boolToVis"/>
    </Page.Resources>
    <Grid>
        <Grid Height="563" Width="780" 
          HorizontalAlignment="Center" VerticalAlignment="Top">
            <Path Data="F1M89,500C86.791,500,85,501.791,85,504L85,504L85,538C85,540.209,86.791,542,89,542L89,542L1081,542C1083.209,542,1085,540.209,1085,538L1085,538L1085,504C1085,501.791,1083.209,500,1081,500L1081,500z" Height="50" Margin="20,0,12,459" Stretch="Fill" Stroke="#FFB6BDBA" VerticalAlignment="Bottom">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFF0F9F6" Offset="0" />
                        <GradientStop Color="sc#1, 0.8645034, 0.9386971, 0.9131128" Offset="0.036626586095394487" />
                        <GradientStop Color="sc#1, 0.849580646, 0.919979036, 0.8946999" Offset="0.046193367402403762" />
                        <GradientStop Color="sc#1, 0.8297841, 0.8951477, 0.8702733" Offset="0.052599494473647423" />
                        <GradientStop Color="sc#1, 0.8061086, 0.86545074, 0.8410604" Offset="0.057584354782454161" />
                        <GradientStop Color="sc#1, 0.7912979, 0.8468732, 0.822785735" Offset="0.059999998658895493" />
                        <GradientStop Color="#FFE6EDEA" Offset="0.059999998658895493" />
                        <GradientStop Color="#FFE6EDEA" Offset="1" />
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <TextBlock FontSize="21" FontWeight="Bold" Margin="28,62,0,464" TextWrapping="Wrap" HorizontalAlignment="Left" Width="217"><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Buscar Usuario" /></TextBlock>
            <Button Content="Buscar" Foreground="Black" Height="34" FontWeight="Bold" Margin="638,62,22,467" Name="SearchBtn" Click="SearchBtn_Click" />
            <Button Content="Buscar" Height="23" HorizontalAlignment="Center" Margin="531,157,133,0" Name="SearchIconBtn" VerticalAlignment="Top" Width="116" Click="SearchBtn_Click" Style="{StaticResource ButtonSearch}"/>
            <DataGrid HeadersVisibility="None" 
                  AutoGenerateColumns="False"  
                  CanUserAddRows="False"
                  Height="298" 
                  HorizontalAlignment="Center"
                  Margin="122,185,132,0" 
                  Name="UserFindedDgv"
                  VerticalAlignment="Top" 
                  Width="525" >
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="Nombres" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                                <Label Content="{Binding Person.Names}" Height="32" VerticalContentAlignment="Center" Style="{StaticResource DataGridLabel}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Apellidos" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                                <Label Content="{Binding Person.LastNames}" Height="16" VerticalContentAlignment="Center" Style="{StaticResource DataGridLabel}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Usuario" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                                <Label Content="{Binding Login}" Height="16" VerticalContentAlignment="Center" Style="{StaticResource DataGridLabel}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Estado" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsActive}">
                                <CheckBox.Template>
                                <ControlTemplate TargetType="CheckBox">
                                    <Grid>
                                                <CheckBox Name="Activo" Content="Activo" Visibility="Hidden" IsChecked="True" VerticalContentAlignment="Center" IsHitTestVisible="False" IsManipulationEnabled="False" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White"/>
                                                <CheckBox Name="Inactivo" Content="Inactivo" Visibility="Hidden" IsChecked="False" VerticalContentAlignment="Center" IsHitTestVisible="False" IsManipulationEnabled="False" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White"/>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsChecked" Value="True">
                                            <Setter TargetName="Activo" Property="Visibility" Value="Visible"/>
                                            <Setter TargetName="Inactivo" Property="Visibility" Value="Hidden"/>
                                        </Trigger>
                                        <Trigger Property="IsChecked" Value="False">
                                            <Setter TargetName="Activo" Property="Visibility" Value="Hidden"/>
                                            <Setter TargetName="Inactivo" Property="Visibility" Value="Visible"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                    </CheckBox.Template>
                                </CheckBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Acciones" Width="100">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">

                                  <CheckBox IsChecked="{Binding IsActive}">
                                        <CheckBox.Template>
                                            <ControlTemplate TargetType="CheckBox" >
                                                <Button Height="32" Name="ShowUserBtn" ToolTip="Mostrar" Width="32" Click="ShowUserBtn_Click">
                                                    <Button.Background>
                                                        <ImageBrush ImageSource="/University.Workshop.Presentation;component/Resources/Icons/file_find.ico" Stretch="Fill" TileMode="FlipXY" Viewport="0,0,32,32" ViewportUnits="Absolute" />
                                                    </Button.Background>
                                                </Button>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsChecked" Value="True">
                                                        <Setter TargetName="ShowUserBtn" Property="IsEnabled" Value="True"/>
                                                        <Setter TargetName="ShowUserBtn" Property="IsHitTestVisible" Value="True"/>
                                                    </Trigger>
                                                    <Trigger Property="IsChecked" Value="False">
                                                        <Setter TargetName="ShowUserBtn" Property="IsEnabled" Value="False"/>
                                                        <Setter TargetName="ShowUserBtn" Property="IsHitTestVisible" Value="False"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </CheckBox.Template>
                                    </CheckBox>

                                    <CheckBox IsChecked="{Binding IsActive}">
                                        <CheckBox.Template>
                                            <ControlTemplate TargetType="CheckBox" >
                                                <Button Height="32" Name="ModifyUserBtn" ToolTip="Modificar" Width="32" Click="ModifyUserBtn_Click">
                                                    <Button.Background>
                                                        <ImageBrush ImageSource="/University.Workshop.Presentation;component/Resources/Icons/file_edit2.ico" />
                                                    </Button.Background>
                                                </Button>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsChecked" Value="True">
                                                        <Setter TargetName="ModifyUserBtn" Property="IsEnabled" Value="True"/>
                                                        <Setter TargetName="ModifyUserBtn" Property="IsHitTestVisible" Value="True"/>
                                                    </Trigger>
                                                    <Trigger Property="IsChecked" Value="False">
                                                        <Setter TargetName="ModifyUserBtn" Property="IsEnabled" Value="False"/>
                                                        <Setter TargetName="ModifyUserBtn" Property="IsHitTestVisible" Value="False"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </CheckBox.Template>
                                    </CheckBox>

                                                <CheckBox IsChecked="{Binding IsActive}">
                                                    <CheckBox.Template>
                                                    <ControlTemplate TargetType="CheckBox" >
                                                    <Grid>
                                                    <Button  Width="32" Height="32" ToolTip="Inhabilitar" Name="EnableUser" Click="EnableUser_Click" Visibility="Hidden">
                                                    <Button.Background>
                                                            <ImageBrush ImageSource="/University.Workshop.Presentation;component/Resources/Icons/file_del.ico" />
                                                    </Button.Background>
                                                    </Button> 
                                                                
                                                    <Button  Width="32" Height="32" ToolTip="Habilitar" Name="DisableUser" Click="EnableUser_Click" Visibility="Hidden">
                                                        <Button.Background>
                                                            <ImageBrush ImageSource="/University.Workshop.Presentation;component/Resources/Icons/file_apply.ico" />
                                                        </Button.Background>
                                                    </Button>
                                                </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsChecked" Value="True">
                                                        <Setter TargetName="EnableUser" Property="Visibility" Value="Visible"/>
                                                        <Setter TargetName="DisableUser" Property="Visibility" Value="Hidden"/>
                                                        </Trigger>
                                                        <Trigger Property="IsChecked" Value="False">
                                                        <Setter TargetName="EnableUser" Property="Visibility" Value="Hidden"/>
                                                        <Setter TargetName="DisableUser" Property="Visibility" Value="Visible"/>
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                        </CheckBox.Template>
                                    </CheckBox>
                              
                                


                                    <Button Width="32" Height="32" ToolTip="Estado" Name="EnableUser" Click="EnableUser_Click" >
                                        <!--Visibility="{Binding Path=VisibilityButtonEnable, Converter={StaticResource boolToVis}}"-->
                                        <Button.Background>
                                        <ImageBrush ImageSource="/University.Workshop.Presentation;component/Resources/Icons/file_apply.ico" />
                                    </Button.Background>
                                </Button>
                            </StackPanel>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
            
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="425,157,0,0" Name="UserStateDdl" SelectedIndex="0" VerticalAlignment="Top" Width="100">
            <ComboBoxItem Content="Activo" />
            <ComboBoxItem Content="Inactivo" />
            <ComboBoxItem Content="Todos" />
        </ComboBox>
        <Rectangle Fill="#43000000" Height="25" HorizontalAlignment="Left" Margin="122,129,0,0" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="525" />
        <!--<my:NumericTextBox Height="23" Margin="122,157,560,0" x:Name="PersonIdRelativeTxBx" Style="{StaticResource NumericTextBox}" VerticalAlignment="Top" />-->
        <TextBox Name="NamesTxBx" Height="23" HorizontalAlignment="Left" Margin="122,157,0,0" MaxLength="55" CommandManager.PreviewCanExecute="CantCupyPasteOrCut" PreviewTextInput="PersonNamesTxt_PreviewTextInput" VerticalAlignment="Top" Width="97" />
        <TextBox Name="lastNamesTxBx" Height="23" HorizontalAlignment="Left" Margin="223,157,0,0" MaxLength="80" CommandManager.PreviewCanExecute="CantCupyPasteOrCut" PreviewTextInput="PersonNamesTxt_PreviewTextInput" VerticalAlignment="Top" Width="97" />
        <TextBox Name="LoginTxBx" Height="23" HorizontalAlignment="Left" Margin="324,157,0,0" MaxLength="30" CommandManager.PreviewCanExecute="CantCupyPasteOrCut" PreviewTextInput="UsernameTxt_PreviewTextInput" PreviewKeyDown="UsernamesTxt_PreviewKeyDown" VerticalAlignment="Top" Width="97" />
        <Label Content="Estado" Height="28" HorizontalAlignment="Left" Margin="430,134,0,0" Name="label1" VerticalAlignment="Top" />
        <Label Content="Nombres" Height="28" HorizontalAlignment="Left" Margin="125,134,0,0" Name="label2" VerticalAlignment="Top" />
        <Label Content="Apellidos" Height="28" HorizontalAlignment="Left" Margin="229,133,0,0" Name="label3" VerticalAlignment="Top" />
        <Label Content="Usuario" HorizontalAlignment="Left" Margin="327,133,0,334" Name="label4" />
    </Grid>
        
        
    <Grid Name="Back1" Opacity="0.7" Background="Gray" Visibility="Hidden"></Grid>
    

        <Grid Name="BackDisable" Height="563" Width="780"  Visibility="Hidden"
          MaxHeight="563" MaxWidth="780" 
          MinHeight="563" MinWidth="780" 
          HorizontalAlignment="Center" VerticalAlignment="Top">

            <!--GRID BLANCO DE FONDO--> 
            <Grid Height="390" HorizontalAlignment="Center" Margin="130,41,113,0" Name="grid1" VerticalAlignment="Top" Width="538" Background="White">
                <TextBlock FontSize="21" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,23,0,397" TextWrapping="Wrap"><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Inhabilitar Kardex" /></TextBlock>
                <Button Content="Cancelar" Height="43" HorizontalAlignment="Left" Margin="100,328,0,0" Name="button1" VerticalAlignment="Top" Width="127" FontSize="21" Background="#FF00D000" Click="button1_Click" />
                <Button Content="Inhabilitar" Height="43" HorizontalAlignment="Left" Margin="340,328,0,0" Name="button2" VerticalAlignment="Top" Width="127" FontSize="21" Background="#FFDC0000" Click="button2_Click" />
                <TextBlock FontSize="21" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,20,0,337" TextWrapping="Wrap"><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Estado Usuario" /></TextBlock>
                <Label Content="Estado:" HorizontalAlignment="Left" Margin="166,295,0,0" Name="label6" VerticalAlignment="Top" />
                <CheckBox Content="-" IsHitTestVisible="False" IsManipulationEnabled="False" HorizontalAlignment="Right" Margin="0,295,257,0" Name="IsActiveChkB" VerticalAlignment="Top" />
            </Grid>
        
            <TextBlock FontSize="21" FontWeight="Bold" HorizontalAlignment="Center" Margin="-348,105,1016,425" TextWrapping="Wrap"><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Cambio de Estado" /></TextBlock>

            <TextBlock FontSize="15" FontWeight="Bold" HorizontalAlignment="Center" TextWrapping="Wrap" Margin="0,116,0,414" ><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Datos Personales" /></TextBlock>
            <Label Content="C.I.:" HorizontalAlignment="Left" Margin="323,160,0,0"  VerticalAlignment="Top" />
            <Label HorizontalAlignment="Left" Name="PersonCiTxt" Margin="357,160,0,0" VerticalAlignment="Top" />
        
            <Label Content="Nombres:" HorizontalAlignment="Left" Margin="289,189,0,0" VerticalAlignment="Top" />
            <Label HorizontalAlignment="Left" Margin="357,189,0,0" Name="PersonNamesForDisableTxt" VerticalAlignment="Top"/>
        
            <Label Content="Apellidos:" HorizontalAlignment="Left" Margin="289,213,0,0" VerticalAlignment="Top" />
            <Label HorizontalAlignment="Left" Margin="357,213,0,0" Name="PersonLastNamesForDisableTxt" VerticalAlignment="Top"/>

            <TextBlock FontSize="15" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,252,0,278" TextWrapping="Wrap"><TextBlock.Effect><DropShadowEffect BlurRadius="1" Color="White" Direction="270" Opacity="0.7" ShadowDepth="1" /></TextBlock.Effect> <Run Language="es-es" Text="Datos del Usuario" /></TextBlock>
            <Label Content="Usuario:" HorizontalAlignment="Left" Margin="289,286,0,0" VerticalAlignment="Top" />
            <Label HorizontalAlignment="Left" Margin="357,286,0,0" Name="PersonLoginForDisabelLbl" VerticalAlignment="Top" />
        
            <Label Content="Rol:" HorizontalAlignment="Left" Margin="314,312,0,0" VerticalAlignment="Top" />
            <Label HorizontalAlignment="Left" Margin="357,312,0,0" Name="PersonRoleForDisableLbl" VerticalAlignment="Top" />
        </Grid>
    </Grid>
</Page>
